import request from '@/utils/request'

const basePath = '/goods/spec/category'

export const categoryTypes = [
	{id: 1, typeName: '可搜索'},
	{id: 2, typeName: '不可搜索'},
]

export const GetAllData = () => {
	return request({
		url: `${basePath}/all`,
		method: 'get',
	})
}

export const GetListData = data => {
	return request({
		url: `${basePath}/list`,
		method: 'post',
		data,
	})
}

export const AddData = data => {
	return request({
		url: `${basePath}/add`,
		method: 'post',
		data,
	})
}

export const ModifyData = data => {
	return request({
		url: `${basePath}/modify`,
		method: 'post',
		data,
	})
}

export const DeleteData = data => {
	return request({
		url: `${basePath}/delete`,
		method: 'post',
		data,
	})
}

export const GetDataByType = t => {
	return request({
		url: `${basePath}/getByType/${t}`,
		method: 'get',
	})
}
